﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleRest.Core.Exceptions;

namespace SimpleRest.Core.Extensions.OAuth.Exceptions
{
    public class InvalidGrantException : WebExceptionBase, IOAuthException
    {
        public InvalidGrantException()
            : base("The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.") { }

        public override System.Net.HttpStatusCode StatusCode
        {
            get { return System.Net.HttpStatusCode.BadRequest; }
        }

        public override string ErrorCode
        {
            get { return "invalid_grant_type"; }
        }

        public string OAuthMessage
        {
            get { return "invalid_grant_type"; }
        }
    }
}
